From: | Sami N��t�nen |
Date: | 19 Sep 99 at 08:30:17 |
Subject: | Re: Rounding amounts |
On 18-Sep-99, Tony Rolfe wrote.
> Australia has no 1 or 2 cent coins, so cash amounts are rounded to the
> nearest 5 cents.
>
> I have a long variable containing the number of cents and need to
> round so numbers ending in 3,4,5,6 or 7 are converted to end in 5, all
> others are to end in zero (1,2 rounded down, 8 & 9 rounded up)
>
> any elegant ideas anyone?
>
> Thanks in advance
this should do the trick
temp.l=cents.l/10*10
t.w=cents-temp
t=(t+2)/5*5
cents=temp+t
Sami N��t�nen
EMail: sami.naatanen@dlc.fi
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie